﻿using System;
using Affinity.Core.Validation;

namespace Affinity.Core.Messages
{
    public class LogMessage : MessageBase
    {
        public LogMessage(string message, string details = null)
        {
            Assert.ArgumentNotNull(message, "message");

            _message = message;
            _details = details ?? string.Empty;
        }

        public string Details
        {
            get { return _details; }
        }
        private readonly string _details; 

        public string Message 
        {
            get { return _message; }            
        }
        private readonly string _message;

        public override string ToString()
        {
            return Message;
        }

        public static implicit operator LogMessage(string logMessage)
        {
            return new LogMessage(logMessage);
        }
    }
}
